package com.example;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Gallery;
import android.widget.Toast;

/**
 * Created by IntelliJ IDEA.
 * User: Eugeny
 * Date: 10.04.12
 * Time: 18:22
 * To change this template use File | Settings | File Templates.
 */
public class GalleryShop extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Gallery gallery = (Gallery) findViewById(R.id.gallery);
        gallery.setAdapter(new ImageAdapter(this));

        gallery.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            public void onItemClick(AdapterView parent, View v, int position, long id) {
                Toast.makeText(GalleryShop.this, "" + position, Toast.LENGTH_SHORT).show();
            }
        });

        View pushButton = this.findViewById(R.id.push);
        pushButton.setOnClickListener(push_click);
    }

    public View.OnClickListener push_click = new View.OnClickListener() {
        public void onClick(View v) {
            GameActivityRun();
        }
    };

    public void GameActivityRun() {
        Intent intent = new Intent(this, GameActivity.class);
        startActivity(intent);
    }

    @Override
    public void onStart(){
        super.onStart();
    }

    @Override
    public void onPause(){
        super.onPause();
    }

    @Override
    public void onStop(){
        super.onStop();
    }

    @Override
    public void onDestroy(){
        super.onDestroy();
    }
}
